package exsun.jt808.data.distribute_data.jt808;

import com.alibaba.fastjson.JSONObject;
import exsun.jt808.data.distribute_data.DistributeEntity;

import java.io.Serializable;

/**
 * 摄像头立即拍摄命令
 */
public class TakePhotoRightAway extends DistributeEntity implements Serializable {
    /**
     * 通道ID >0
     */
    private int channelId;
    /**
     * 拍摄命令
     * 0 表示停止拍摄；0xFFFF 表示录像；其它表示拍照张数
     */
    private int cmd;
    /**
     * 拍照间隔/录像时间
     * 秒，0 表示按最小间隔拍照或一直录像
     */
    private int time;
    /**
     * 保存标志
     * 1：保存；0：实时上传
     */
    private int saveType = 0;
    /**
     * 分辨率
     * 0x01:320*240；
     * 0x02:640*480；
     * 0x03:800*600；
     * 0x04:1024*768;
     * 0x05:176*144;[Qcif];
     * 0x06:352*288;[Cif];
     * 0x07:704*288;[HALF D1];
     * 0x08:704*576;[D1];
     * 终端若不支持系统要求的分辨率，则取最接近的分辨率拍摄并上传
     */
    private int resolutionRatio = 1;
    /**
     * 图像/视频质量
     * 1-10，1 代表质量损失最小，10 表示压缩比最大
     */
    private int quality = 1;
    /**
     * 亮度
     * 0-255
     */
    private int brightness = 0;
    /**
     * 对比度
     * 0-127
     */
    private int contrast = 0;
    /**
     * 饱和度
     * 0-127
     */
    private int saturation = 0;
    /**
     * 色度
     * 0-255
     */
    private int chroma = 0;

    private  long operationTime=0;


    public  long getOperationTime()
    {
        return  this.operationTime;
    }
    public  void setOperationTime(long operationTime ) {
        this.operationTime = operationTime;
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        this.channelId = channelId;
    }

    public int getCmd() {
        return cmd;
    }

    public void setCmd(int cmd) {
        this.cmd = cmd;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public int getSaveType() {
        return saveType;
    }

    public void setSaveType(int saveType) {
        this.saveType = saveType;
    }

    public int getResolutionRatio() {
        return resolutionRatio;
    }

    public void setResolutionRatio(int resolutionRatio) {
        this.resolutionRatio = resolutionRatio;
    }

    public int getQuality() {
        return quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public int getBrightness() {
        return brightness;
    }

    public void setBrightness(int brightness) {
        this.brightness = brightness;
    }

    public int getContrast() {
        return contrast;
    }

    public void setContrast(int contrast) {
        this.contrast = contrast;
    }

    public int getSaturation() {
        return saturation;
    }

    public void setSaturation(int saturation) {
        this.saturation = saturation;
    }

    public int getChroma() {
        return chroma;
    }

    public void setChroma(int chroma) {
        this.chroma = chroma;
    }

    public JSONObject toJSONString() {

        JSONObject object = new JSONObject();
        object.put("channelId",channelId);
        object.put("cmd",cmd);
        object.put("time",time);
        object.put("saveType",saveType);
        object.put("resolutionRatio",resolutionRatio);
        object.put("quality",quality);
        object.put("brightness",brightness);
        object.put("contrast",contrast);
        object.put("saturation",saturation);
        object.put("chroma",chroma);
        return object;
    }
}
